{include file=buyer.header.html}
<script src="{lib file=mlselection.js}" charset="utf-8"></script>
<script src="{lib file=jquery.plugins/jquery.validate.js}" charset="utf-8"></script>
<script src="{lib file=jquery.plugins/additional-methods.js}" charset="utf-8"></script>
<style type="text/css">
.d_inline{display:inline;}
</style>
<div class="content">
<script type="text/javascript">
//<!CDATA[
var SITE_URL = "{$site_url}";
var REAL_SITE_URL = "{$real_site_url}";
$(function(){
    regionInit("region");

    $("#apply_form").validate({
        errorPlacement: function(error, element){
            var error_td = element.parents('td').next('td');
            error_td.find('.field_notice').hide();
            error_td.find('.fontColor3').hide();
            error_td.append(error);
        },
        success: function(label){
            label.addClass('validate_right').text('OK!');
        },
        rules: {
            owner_name: {
                required: true
            },
            store_name: {
                required: true,
                remote : {
                    url  : 'index.php?app=apply&act=check_name&ajax=1',
                    type : 'get',
                    data : {
                        store_name : function(){
                            return $('#store_name').val();
                        },
                        store_id : '{$store.store_id}'
                    }
                },
                maxlength: 20
            },
            pay_account_name: {
                required: true
            },
	pay_account: {
                required: true
            },
	pay_bank: {
                required: true
            },
            region_name:{
                required:true,
                minlength:9
            },
            /*owner_card:{
                required:true,
                isIdCard:true
            },*/
			
            tel: {
                required: true,
                isMobile:true
            },
            image_1: {
                accept: "jpg|jpeg|png|gif"
            },
            image_2: {
                accept: "jpg|jpeg|png|gif"
            },
            image_3: {
                accept: "jpg|jpeg|png|gif"
            },
            notice: {
                required : true
            }
        },
        messages: {
            owner_name: {
                required: '{$lang.input_owner_name}'
            },
            store_name: {
                required: '{$lang.input_store_name}',
                remote: '{$lang.name_exist}',
                maxlength: '{$lang.note_for_store_name}'
            },
            /*owner_card:{
                required:'身份证不能为空'
            },*/
	        pay_account_name: {
                required: '请输入商户结算账户名称'
            },
	        pay_account: {
                required: '请输入结算账号'
            },
	         pay_bank: {
                required: '请输入开户行'
            },
            region_name:{
                required: '请选择所在地区',
                minlength: '请选择到最后一项'
            },
			
            tel: {
                required: '{$lang.input_tel}'
            },
            image_1: {
                accept: '{$lang.select_valid_image}'
            },
            image_2: {
                accept: '{$lang.select_valid_image}'
            },
            image_3: {
                accept: '{$lang.select_valid_image}'
            },
            notice: {
                required: '{$lang.check_notice}'
            }
        }
    });
});
//]]>
</script>
    <div class="module_common">
        <h2><b class="set_up_shop" title="SHOP REGISTRATION{$lang.i_want_open_store}">{$lang.i_want_open_store}</b></h2>
        <div class="openshopwrap">
            <div class="wrap_child">

                <div class="module_new_shop">

                    <div class="chart">
                        <div class="pos_x1 bg_a1" title="{$lang.step_1}"></div>
                        <div class="pos_x2 bg_b2" title="{$lang.step_2}"></div>
                        <div class="pos_x3 bg_c" title="{$lang.step_3}"></div>
                    </div>

                    <div class="info_shop">
                        <form method="post" enctype="multipart/form-data" id="apply_form">
                        <table>
                            <tr>
                                <td width="90" class="title">{$lang.owner_name} : </td>
                                <td width="340"><input name="owner_name" type="text" class="text width7" value="{$store.owner_name|escape}" maxlength="32"/></td>
                                <td width="500"><span class="fontColor3">*</span> <span class="field_notice">{$lang.note_for_owner_name}</span></td>
                            </tr>
                           <!-- <tr>
                                <td class="title">{$lang.owner_card} : </td>
                                <td><input type="text" class="text width7" name="owner_card" value="{$store.owner_card|escape}"></td>
                                <td><span class="fontColor3">*</span><span class="field_notice">{$lang.note_for_owner_card}</span></td>
                            </tr> -->
                            <tr>
                                <td class="title">{$lang.store_name} : </td>
                                <td><input name="store_name" type="text" class="text width7" id="store_name" value="{$store.store_name|escape}" maxlength="20"/></td>
                                <td><span class="fontColor3">*</span> <span class="field_notice">{$lang.note_for_store_name}</span></td>
                            </tr>
                           
                            <tr>
                                <td class="title">结算账户名 : </td>
                                <td><input name="pay_account_name" type="text" class="text width7" id="pay_account_name" value="{$store.pay_account_name|escape}" maxlength="50"/></td>
                                <td><span class="fontColor3">*</span> <span class="field_notice">请填写商户结算账户名称</span></td>
                            </tr>
                            <tr>
                                <td class="title">结算账号 : </td>
                                <td><input name="pay_account" type="text" class="text width7" id="pay_account" value="{$store.pay_account|escape}" maxlength="25"/></td>
                                <td><span class="fontColor3">*</span> <span class="field_notice">请填写结算账号</span></td>
                            </tr>
                            <tr>
                                <td class="title">开户行 : </td>
                                <td><input name="pay_bank" type="text" class="text width7" id="pay_bank" value="{$store.pay_bank|escape}" maxlength="20"/></td>
                                <td><span class="fontColor3">*</span> <span class="field_notice">请填写开户行</span></td>
                            </tr>
                              <tr>
                                <td class="title">发票抬头 : </td>
                                <td><input name="pay_invoice" type="text" class="text width7" id="pay_invoice" value="{$store.pay_invoice|escape}" maxlength="50"/></td>
                                <td><span class="field_notice">请填写开具发票单位名称</span></td>
                            </tr>
                             <tr>
                                <td class="title">结算支付方式 : </td>
                                <td><div class="select_add"><select name="pay_type">
            <!--{foreach from=$cfg_store_pay_type item=bank key=key name=v}-->
            <option value="{$key}">{$bank}</option>
            <!--{/foreach}-->               
              </select>
                                    </div></td>
                                <td><span class="field_notice">请选择商户结算的支付方式</span></td>
                            </tr>
                            <!--<tr>
                                <td class="title">{$lang.store_category} : </td>
                                <td>
                                    <div class="select_add"><select name="cate_id">
                                    <option value="0">{$lang.select_pls}</option>
                                    {html_options options=$scategories selected=$scategory.cate_id}
                                    </select>
                                    </div>
                                </td>
                                <td>&nbsp;</td>
                            </tr> -->
                            <tr>
                                <td class="title">{$lang.region} : </td>
                                <td>
                                <div class="select_add" id="region" style="widtd:500px;border:1px solide red;">
                                    <input type="hidden" name="region_id" value="{$store.region_id}" class="mls_id" />
                                    <input type="hidden" name="region_name" value="{$store.region_name}" class="mls_names" />
                                    {if $store.region_name}
                                    <span>{$store.region_name|escape}</span>
                                    <input type="button" value="{$lang.edit}" class="edit_region" />
                                    {/if}
                                    <select class="d_inline"{if $store.region_name} style="display:none;"{/if}>
                                    <option value="0">{$lang.select_pls}</option>
                                    {html_options options=$regions}
                                    </select>
                                </div>
                                </td>
                                <td><span class="fontColor3">*</span> <span class="field_notice">请选择所在地区</span></td>
                            </tr>
                            <tr>
                                <td class="title">{$lang.address} : </td>
                                <td><input name="address" type="text" class="text width7" value="{$store.address|escape}" maxlength="50"/></td>
                                <td>&nbsp;</td>
                            </tr>
                          <!--  <tr>
                                <td class="title">{$lang.zipcode} : </td>
                                <td><input name="zipcode" type="text" class="text width7" value="{$store.zipcode|escape}" maxlength="6"/></td>
                                <td>&nbsp;</td>
                            </tr> -->
                            <tr>
                                <td class="title">{$lang.tel} : </td>
                                <td>
                                    <input name="tel" type="text" class="text width7" onkeyup="this.value=this.value.replace(/\D/g,'')"  value="{$store.tel|escape}" maxlength="20" />
                              </td>
                                <td><span class="fontColor3">*</span> <span class="field_notice">{$lang.input_tel}</span></td>
                            </tr>
                            <tr>
                                <td class="title">{$lang.upload_image} : </td>
                                <td><input type="file" name="image_1" />
                                {if $store.image_1}<p style="display:inline;"><a href="{$site_url}/{$store.image_1}" target="_blank">{$lang.view}</a></p>{/if}
                                </td>
                                <td><span class="field_notice">{$lang.note_for_image}</span></td>
                            </tr>
                            <tr>
                                <td class="title">{$lang.upload_permit} : </td>
                                <td><input type="file" name="image_2" />
                                {if $store.image_2}<p style="display:inline;"><a href="{$site_url}/{$store.image_2}" target="_blank">{$lang.view}</a></p>{/if}
                                </td>
                                <td><span class="field_notice">{$lang.note_for_image}</span></td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td colspan="2"><p class="padding4"><input type="checkbox"{if $store} checked="checked"{/if} name="notice" value="1" id="warningin" checked /> <label for="warningin">{$lang.notice}</label></p></td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td colspan="2"><p class="padding4"><input class="subbtnhsb pl30 pr30" type="submit" value="提交" /></p></td>
                            </tr>
                        </table>
                        </form>
                    </div>

                </div>

            </div>
        </div>
    </div>

</div>
{include file=footer.html}
